# $Id$
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Jason Chu <jason@archlinux.org>

pkgname=lyx
pkgver=2.2.3
pkgrel=3
pkgdesc="An advanced WYSIWYM document processor & LaTeX front-end"
arch=('i686' 'x86_64')
url="http://www.lyx.org"
depends=('qt5-svg' 'texlive-core' 'python2' 'imagemagick' 'enchant' 'boost-libs' 'libmythes' 'file'
         'hicolor-icon-theme')
makedepends=('boost' 'bc')
optdepends=('rcs: built-in version control system'
            'texlive-latexextra: float wrap support')
license=('GPL')
backup=('etc/lyx/lyxrc.dist')
options=('emptydirs')
source=(ftp://ftp.lyx.org/pub/lyx/stable/2.2.x/$pkgname-$pkgver.tar.xz
        lyxrc.dist)
sha1sums=('8c9946ab8ee762f1e21467dbf066f0adef6261d1'
          '56416642cc3da2a13b87b84e6b87c1a239f3d09a')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  export CXXFLAGS="$CXXFLAGS -fpermissive"
  ./configure --prefix=/usr \
    --enable-qt5 --without-included-boost \
    --without-included-mythes
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  # install default config file
  install -Dm644 "${srcdir}/lyxrc.dist" "${pkgdir}/etc/lyx/lyxrc.dist"
  ln -sf /etc/lyx/lyxrc.dist "${pkgdir}/usr/share/lyx/lyxrc.dist"
}
